class PerfumeModel {
  final int id;
  final String category;
  final int userId;
  final String title;
  final String description;
  final bool isRecommend;
  final bool isVideo;
  final String url;
  final String? cover;
  final int favoriteCount;
  final int likeCount;
  final int commentCount;

  PerfumeModel({
    required this.id,
    required this.category,
    required this.userId,
    required this.title,
    required this.description,
    required this.isRecommend,
    required this.isVideo,
    required this.url,
    this.cover,
    required this.favoriteCount,
    required this.likeCount,
    required this.commentCount,
  });

  factory PerfumeModel.fromJson(Map<String, dynamic> json) => PerfumeModel(
    id: json['id'],
    category: json['category'],
    userId: json['userId'],
    title: json['title'],
    description: json['description'],
    isRecommend: json['isRecommend'],
    isVideo: json['isVideo'],
    url: json['url'],
    cover: json['cover'],
    favoriteCount: json['favoriteCount'],
    likeCount: json['likeCount'],
    commentCount: json['commentCount'],
  );

  Map<String, dynamic> toJson() => {
    'id': id,
    'category': category,
    'userId': userId,
    'title': title,
    'description': description,
    'isRecommend': isRecommend,
    'isVideo': isVideo,
    'url': url,
    'cover': cover,
    'favoriteCount': favoriteCount,
    'likeCount': likeCount,
    'commentCount': commentCount,
  };
}
